<!DOCTYPE html>
<html>
<head>
	<title>后台管理</title>
	<link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="/stylesheets/admin.css">
	<script src="//cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
	<script src="/javascripts/main.js"></script>
	<style type="text/css">
		body { padding-top: 70px; }
		.navbar-fixed-top h5{margin-top: 17px;}
		p{height: 60px;text-overflow:ellipsis;overflow: hidden;}
		th{text-align: center;}
	</style>
</head>
<body>
	<nav class="navbar navbar-default navbar-fixed-top">
		<div class="container">
			<h5>欢迎<a href="/admin/modify"><%= username%></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/admin/logout">退出</a></h5>
		</div>
	</nav>

	<div class="container">
		<div class="row">
		<%if(success!=""){%>
			<div class="alert alert-success" role="alert">
				<%= success%>
				<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			</div>
		<%}%>
			<h3 class="page-header">文章列表<a class="btn btn-primary pull-right" href="/admin/addArticle">添加文章</a></h3>
			<table class="table">
				<tr>
					<th>序号</th>
					<th>文章标题</th>
					<th>文章内容</th>
					<th>操作</th>
				</tr>
				<% for(var i=0;i<news.length;i++){ %>
				<tr>
					<td style="width: 10%;text-align: center;"><%= news[i].id%></td>
					<td style="width:30%;"><%= news[i].title%></td>
					<td style="width: 45%;"><p><%= news[i].content%></p></td>
					<td style="width:15%px;text-align: center;">
						<a class="btn btn-info" href="/admin/updateArticle?id=<%= news[i].id%>">修改</a>
						<a id="del" class="btn btn-danger" href="/admin/delArticle?id=<%= news[i].id%>">删除</a>
					</td>
				</tr>
				<% } %>
			</table>
		</div>
	</div>
</body>
</html>
<script type="text/javascript">
	
	setTimeout(function(){
		$('.alert').fadeOut(2000);
	},2000)
</script>